import { Controller,Body,Post } from '@nestjs/common';
import {PostsService} from './posts.service'
@Controller('posts')
export class PostsController {
  constructor(
     private readonly postsService:PostsService
  ){}

  @Post('/add')
  async add(
    @Body() data:any
  ){
  const result =  await this.postsService.add(data)
  return result
  }

  @Post('/delete')
  async delete(
    @Body() data:any
  ){
  const result =  await this.postsService.delete(data)
  return result
  }

  @Post('/update')
  async update(
    @Body() data:any
  ){
  const result =  await this.postsService.update(data)
  return result
  }
}
